Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check hooked nodes in executeWfLifeCycleHook and executeTmplLifeCycleHook (#11113, #11117) #11176

Merged
merged 2 commits into from
Jun 4, 2023

Conversation

toyamagu-2021
Copy link
Member

@toyamagu-2021 toyamagu-2021 commented Jun 4, 2023

Signed-off-by: [email protected] [email protected]

Fixes #11113
Fixes #11117

Motivation

  • Check hooked node statuses even workflows completed.

Modifications

  • Check hooked node statuses in executeWfLifeCycleHook and executeTmplLifeCycleHook

Verification

manifest ```yaml apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: example-steps-simple-mutex spec: entrypoint: main

templates:
- name: main
steps:
- - name: job-1
template: sleep
arguments:
parameters:
- name: sleep_duration
value: 30
hooks:
running:
expression: steps['job-1'].status == "Running"
template: hook
arguments:
parameters:
- name: sleep_duration
value: 5
- name: context
value: "job-1"
success:
expression: steps['job-1'].status == "Succeeded"
template: hook
arguments:
parameters:
- name: sleep_duration
value: 5
- name: context
value: "job-1"
- name: job-2
template: sleep
arguments:
parameters:
- name: sleep_duration
value: 30
hooks:
running:
expression: steps['job-2'].status == "Running"
template: hook
arguments:
parameters:
- name: sleep_duration
value: 5
- name: context
value: "job-2"
success:
expression: steps['job-2'].status == "Succeeded"
template: hook
arguments:
parameters:
- name: sleep_duration
value: 5
- name: context
value: "job-2"
- name: job-3
template: sleep
arguments:
parameters:
- name: sleep_duration
value: 30
hooks:
running:
expression: steps['job-3'].status == "Running"
template: hook
arguments:
parameters:
- name: sleep_duration
value: 45
- name: context
value: "job-3"
success:
expression: steps['job-3'].status == "Succeeded"
template: hook
arguments:
parameters:
- name: sleep_duration
value: 5
- name: context
value: "job-3"

- name: hook
  synchronization:
    mutex:
      name: "{{ inputs.parameters.context }}"
  inputs:
    parameters:
      - name: sleep_duration
      - name: context
  script:
    image: alpine:latest
    command: [/bin/sh]
    source: |
      echo "Fake API call - sleeping for {{ inputs.parameters.sleep_duration }}, context is {{ inputs.parameters.context }}"
      sleep {{ inputs.parameters.sleep_duration }}

- name: sleep
  inputs:
    parameters:
      - name: sleep_duration
  script:
    image: alpine:latest
    command: [/bin/sh]
    source: |
      echo "Sleeping for {{ inputs.parameters.sleep_duration }}"
      sleep {{ inputs.parameters.sleep_duration }}
</details>

@toyamagu-2021 toyamagu-2021 changed the title fix: check hooked nodes fix: check hooked nodes in executeWfLifeCycleHook Jun 4, 2023
@toyamagu-2021 toyamagu-2021 changed the title fix: check hooked nodes in executeWfLifeCycleHook fix: check hooked nodes in executeWfLifeCycleHook (#11113, #11117) Jun 4, 2023
@toyamagu-2021 toyamagu-2021 marked this pull request as ready for review June 4, 2023 13:06
@toyamagu-2021 toyamagu-2021 changed the title fix: check hooked nodes in executeWfLifeCycleHook (#11113, #11117) fix: check hooked nodes in executeWfLifeCycleHook and executeTmplLifeCycleHook (#11113, #11117) Jun 4, 2023
@toyamagu-2021
Copy link
Member Author

@sarabala1979
Hi, could you take a look at this?

@sarabala1979 sarabala1979 merged commit 0c5a6dd into argoproj:master Jun 4, 2023
JPZ13 pushed a commit to pipekit/argo-workflows that referenced this pull request Jul 4, 2023
jeremyhager pushed a commit to jeremyhager/argo-workflows that referenced this pull request Jul 7, 2023
dpadhiar pushed a commit to dpadhiar/argo-workflows that referenced this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants